import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

const routes = [
  {
    path: "/",
    name: "index",
    redirect: "/home",
  },
  {
    path: "/home",
    name: "home",
    component: () => import("@/views/home/home.vue"),
    children: [
      {
        path: "",
        redirect: "/home/recommend",
      },
      {
        path: "recommend",
        name: "homeRecommend",
        component: () =>
          import("@/views/home/components/homeRecommend/homeRecommend.vue"),
      },
      {
        path: "playList",
        name: "homePlayList",
        meta: { keepAlive: true },
        component: () =>
          import("@/views/home/components/playListPage/playList.vue"),
      },
    ],
  },
  {
    path: "/albumAndSongSheet",
    name: "albumAndSongSheet",
    component: () => import("@/views/albumPage/albumPage.vue"),
  },
  {
    path: "/hotComments",
    name: "hotComments",
    component: () => import("@/views/hotComments/hotComments.vue"),
  },
];

const router = createRouter({
  routes,
  history: createWebHashHistory(),
});

export default router;
